#ifndef FORM_UNDRUG_H
#define FORM_UNDRUG_H

#include "pub_pop_get_item.h"

#include <QWidget>
#include <QJsonObject>
#include <QJsonArray>
#include <QSqlQuery>
#include <QMap>
#include <QSqlQueryModel>


namespace Ui {
class Form_undrug;
}

class Form_undrug : public QWidget
{
    Q_OBJECT

public:
    explicit Form_undrug(QWidget *parent = nullptr);
    ~Form_undrug();

    void closeEvent(QCloseEvent *event);

signals:
    void destroyW( QString );

private slots:

    void clear_screen();
    bool check_status();

    void on_pb_search_clicked();

    void on_pb_exit_clicked();

    void on_pb_add_clicked();

    void on_le_undrug_name_textChanged(const QString &arg1);

    void on_tv_undrug_items_clicked(const QModelIndex &index);

    void on_pb_save_clicked();

    void on_le_key_returnPressed();

private:
    Ui::Form_undrug *ui;


    QSqlQuery *qrm, *qro, *qrot;
    //QSqlQueryModel mdList ;//
    QString sq;
    QSqlQueryModel *md;
    QSqlQueryModel *md_pop;
    QSqlQueryModel *md_group;

    Pub_pop_get_item * dlg_getItem;

    bool is_new_item;

    QString fee_code, sys_class, oper_dept;

};

#endif // FORM_UNDRUG_H
